package com.team.childapp.util;

import android.util.Log;

/**
 * Create on: 9/14/21
 * by Mr.Zhu
 * Description: log打印类
 */
public class LogUtils {
    private static LogUtils utils;
    private static final boolean DEBUG = true;
    private static final boolean ERROR_LOG = true;
    private static final String TAG = "activity_mine";

    private LogUtils() {
    }

    public static synchronized LogUtils getInstance() {
        if (utils == null) {
            utils = new LogUtils();
        }
        return utils;
    }

    /**
     * 打印日志
     * TAG activity_mine
     *
     * @param msg
     */
    public static void showLog(String msg) {
        showLog(TAG, msg);
    }

    /**
     * 打印日志，自定义TAG
     *
     * @param msg
     * @param Tag
     */
    public static void showLog(String Tag, String msg) {
        if (DEBUG) {
            Log.i(Tag, msg);
        }
    }


    /**
     * 打印错误日志
     *
     * @param e
     */
    public static void showErrorLog(Exception e) {
        if (ERROR_LOG) {
            e.printStackTrace();
        }
    }
}
